<?php
class ShareModel extends Model {

	public function get_primary_key() {
		return $this->primary_key = 'id';
	}

    public function set($id, $data) {
        if ($id) {
            $this->db->update('share', $data,array('id'=>$id));
            return $id;
        }
        $return = $this->db->insert('share', $data);
        if ($return) return $return;
        return false;
    }

    public function del($member_id,$id)
    {
        $this->db->delete('share',array('id'=>$id,'member_id'=>$member_id));
        return $id;
    }

    public function del2($id)
    {
        $this->db->delete('share',array('id'=>$id));
        return $id;
    }


    public function get_one($where){
        $sql = "select id from ".$this->prefix."share where $where";
        $res = $this->db->query($sql)->row_array();
        return $res;
    }


	
	
	
	
	
	


}